#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <linux/limits.h>
#include "rocerror.h" // 添加头文件

int main(int argc, char *argv[])
{
    char filename[PATH_MAX] = {0};

    if (argc != 2)
    {
        fprintf(stderr, "You must supply a filename as an argument \n");
        return 1;
    }

    strncpy(filename, argv[1], PATH_MAX - 1);
    filename[PATH_MAX - 1] = '\0';

    if (creat(filename, 0644) == -1)
    {
        unix_error("File creation failed"); // 单行错误处理
    }

    return 0;
}